from ultralytics import YOLO

# Load a model

model = YOLO('yolov8s.pt')

# Train the model
results = model.train(
    data=r'./dataset.yaml', 
    epochs=50, 
    imgsz=640,
    batch=10,
    save_period=10,
    plots=True
    )